package com.ruoyi.controller;

import java.util.List;

import com.ruoyi.entity.VO.T09VO;
import com.ruoyi.framework.web.service.TokenService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.domain.T09;
import com.ruoyi.service.YYDIT09Service;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 知识库Controller
 *
 * @author ruoyi
 * @date 2024-07-27
 */
@RestController
@RequestMapping("/T09/T09")
public class YYDT09Controller extends BaseController
{
    @Autowired
    private YYDIT09Service t09Service;
    @Autowired
    private TokenService tokenService;

    /**
     * 查询知识库列表
     */
//    @PreAuthorize("@ss.hasPermi('T09:T09:list')")
    @GetMapping("/list")
    public TableDataInfo list(T09 t09)
    {
        startPage();
        List<T09> list = t09Service.selectT09List(t09);
        return getDataTable(list);
    }
    /**
     * 修改知识库
     */
    @PreAuthorize("@ss.hasPermi('T09:T09:edit')")
    @Log(title = "知识库", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody T09 t09)
    {
        return toAjax(t09Service.updateT09(t09));
    }
}
